#!/bin/sh
# This regression test is a part of SIPp.
# [last_cseq_number] of a message without a CSeq header is 0, not a
# number read from the [last_*] header before it.
. "`dirname "$0"`/../functions"; init

sippbg -sf uas.xml -i 127.0.0.1 -p 27410 -m 1 -timeout 4 \
    -trace_logs -log_file log.log
sippfg -sf uac.xml -i 127.0.0.1 -p 27411 -m 1 127.0.0.1:27410 \
    -timeout 4 >/dev/null 2>&1
status=$?
wait
log=`cat log.log 2>/dev/null`
rm -f log.log

if test $status -ne 0; then
    fail "exit status $status"
elif test "$log" != "To: 1234567 0"; then
    fail "logged '$log'"
else
    ok
fi
